home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 15570 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: news.ov.com!news
  2. From: glenn@ov.com (Fletcher.Glenn@ov.com)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Linking libs with libs.
  5. Date: 20 Apr 1996 00:15:25 GMT
  6. Organization: OpenVision
  7. Message-ID: <4l9aat$2a0@spanky.pls.ov.com>
  8. References: <3177F0D7.7335@arcs.bcit.bc.ca>
  9. Reply-To: glenn@ov.com
  10. NNTP-Posting-Host: foghorn.pls.ov.com
  11.  
  12. In article 7335@arcs.bcit.bc.ca, Travis Koch <travis@arcs.bcit.bc.ca> writes:
  13. >we have a problem..
  14. >developing a large project in Solaris 2.4, using 
  15. >gcc 2.6.3 linking with f77 (don't ask).
  16. >
  17. >BTW f77 just calls Sun's ld, including some fortran 
  18. >libs along the way.
  19. >
  20. >We have 2 static libraries which we need to keep 
  21. >separate.
  22. >
  23. >I'm calling a function defined in libA.a from 
  24. >libB.a.  when compiling a small driver program, the  
  25. >function is called only from the lib, and is 
  26. >therefore not linked in.  
  27. >
  28. >Question.
  29. >
  30. >does anyone know of a way to force linking of a 
  31. >function from a static lib, even when its not 
  32. >called?  
  33. >
  34. >TIA
  35.  
  36.  
  37. Use ar to extract the object you want, then include the object in your
  38. list of .o files to be linked.
  39.  
  40.             Fletcher.Glenn@ov.com
  41.  
  42.  
  43.